<template>
	<view class="body">
		<input 
		type="password" 
		class="uni-input common-input" 
		placeholder="输入旧密码"
		v-model="oldpasword"
		/>
		<input 
		type="password" 
		class="uni-input common-input" 
		placeholder="输入新密码"
		v-model="newpasword"
		/>
		<input 
		type="password" 
		class="uni-input common-input" 
		placeholder="输入确认密码"
		v-model="renewpasword"
		/>
		<button 
		type="primary" 
		class="user-set-btn"
		:loading="loading"
		@tap="submit"
		>完成</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				oldpasword:'',
				newpasword:'',
				renewpasword:'',
				disabled: true,
				loading: false
			}
		},
		methods: {
			check(){
				this.loading = true;
				if(!this.oldpasword || !this.newpasword || !this.renewpasword){
					uni.showToast({
						title:'请填写密码',
						icon: 'none'
					});
					this.loading = false;
                    return;
				}
				if(this.newpasword !== this.renewpasword){
					uni.showToast({
						title:'新密码与确认密码不一致',
						icon: 'none'
					});
					this.loading = false;
					return;
				}
			},
			submit(){
				this.check();
				
				
			}
		}
	}
</script>

<style scoped>
@import '../../common/form.css';
</style>
